﻿using Microsoft.AspNetCore.Mvc;
using ProjectScheduling_web.model.Enums;

namespace ProjectScheduling_web.Controllers.U
{
    public class EnumController : BController
    {
        private IActionResult O<T>() where T : Enum
        {
            var lst = Enum.GetValues(typeof(T)).Cast<T>().Select(it => new { id = Convert.ToInt32(it), name = it.ToString() }).ToList();
            return Success(lst);
        }
        [HttpGet]
        public IActionResult CustomerType() => O<EnumCustomerType>();
        [HttpGet]
        public IActionResult DictionaryCategory() => O<EnumDictionaryCategory>();
    }
}
